﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using System.Text;
using System.Threading.Tasks;

namespace InChatter.Service.Host
{
    class Program
    {
        static void Main(string[] args)
        {
            using (ServiceHost host = new ServiceHost(typeof(Chat)))
            {
                host.Opened += host_Opened;
                try
                {
                    host.Open();
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
                Console.WriteLine("Press 'exit' to exit!");
                string enterStr = Console.ReadLine();
                while (enterStr.ToLower() != "exit")
                {
                    enterStr = Console.ReadLine();
                }
            }
        }

        public static void host_Opened(object sender, EventArgs e)
        {
            Console.WriteLine("Service Opened!");
        }
    }
}




